#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vuicorn with fastapi
import uvicorn
from fastapi import FastAPI


app = FastAPI()


@app.get('/')
async def index():
    return 'hello'


if __name__ == '__main__':
    # uvicorn.run(app, host="localhost", port=24680)
    # 当启用reload参数热加载后，app参数必须使用字符串module:app_var
    uvicorn.run(app='demo2fastapi:app', host="localhost", port=24680, debug=True, log_level='info', reload=True)